package com.pyb.redis.service;

/**
 * @version 1.0
 * @Author 彭彦彬
 * @Date 2025/3/18 15:38
 * @注释
 */
import com.pyb.redis.mapper.StudentRepository;
import com.pyb.redis.pojo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;

@Service
public class StudentService {

    @Autowired
    private StudentRepository repository;

    public void saveOrUpdateStudent(Student student) {
        repository.saveStudent(student);
    }

    public Map<String, Student> getAllStudents() {
        return repository.findAllStudents();
    }

    public Student getStudentById(String id) {
        return repository.findStudentById(id);
    }

    public void deleteStudent(String id) {
        repository.deleteStudent(id);
    }
}